/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package virtual.BD;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Rafael
 */
@Entity
@Table(name = "turma")
@NamedQueries({
    @NamedQuery(name = "Turma.findAll", query = "SELECT t FROM Turma t"),
    @NamedQuery(name = "Turma.findByCdTurma", query = "SELECT t FROM Turma t WHERE t.cdTurma = :cdTurma"),
    @NamedQuery(name = "Turma.findByNmTurma", query = "SELECT t FROM Turma t WHERE t.nmTurma = :nmTurma"),
    @NamedQuery(name = "Turma.findByDtInicioTurma", query = "SELECT t FROM Turma t WHERE t.dtInicioTurma = :dtInicioTurma"),
    @NamedQuery(name = "Turma.findByDtFimTurma", query = "SELECT t FROM Turma t WHERE t.dtFimTurma = :dtFimTurma"),
    @NamedQuery(name = "Turma.findByCdProfessor", query = "SELECT t FROM Turma t WHERE t.cdProfessor = :cdProfessor"),
    @NamedQuery(name = "Turma.findByCdDisciplina", query = "SELECT t FROM Turma t WHERE t.cdDisciplina = :cdDisciplina")})
public class Turma implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "cd_turma")
    private Integer cdTurma;
    @Basic(optional = false)
    @Column(name = "nm_turma")
    private String nmTurma;
    @Column(name = "dt_inicio_turma")
    @Temporal(TemporalType.DATE)
    private Date dtInicioTurma;
    @Column(name = "dt_fim_turma")
    @Temporal(TemporalType.DATE)
    private Date dtFimTurma;
    @Column(name = "cd_professor")
    private Integer cdProfessor;
    @Column(name = "cd_disciplina")
    private Integer cdDisciplina;

    public Turma() {
    }

    public Turma(Integer cdTurma) {
        this.cdTurma = cdTurma;
    }

    public Turma(Integer cdTurma, String nmTurma) {
        this.cdTurma = cdTurma;
        this.nmTurma = nmTurma;
    }

    public Integer getCdTurma() {
        return cdTurma;
    }

    public void setCdTurma(Integer cdTurma) {
        this.cdTurma = cdTurma;
    }

    public String getNmTurma() {
        return nmTurma;
    }

    public void setNmTurma(String nmTurma) {
        this.nmTurma = nmTurma;
    }

    public Date getDtInicioTurma() {
        return dtInicioTurma;
    }

    public void setDtInicioTurma(Date dtInicioTurma) {
        this.dtInicioTurma = dtInicioTurma;
    }

    public Date getDtFimTurma() {
        return dtFimTurma;
    }

    public void setDtFimTurma(Date dtFimTurma) {
        this.dtFimTurma = dtFimTurma;
    }

    public Integer getCdProfessor() {
        return cdProfessor;
    }

    public void setCdProfessor(Integer cdProfessor) {
        this.cdProfessor = cdProfessor;
    }

    public Integer getCdDisciplina() {
        return cdDisciplina;
    }

    public void setCdDisciplina(Integer cdDisciplina) {
        this.cdDisciplina = cdDisciplina;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cdTurma != null ? cdTurma.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Turma)) {
            return false;
        }
        Turma other = (Turma) object;
        if ((this.cdTurma == null && other.cdTurma != null) || (this.cdTurma != null && !this.cdTurma.equals(other.cdTurma))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "virtual.BD.Turma[cdTurma=" + cdTurma + "]";
    }

}
